package sg.java.concepts.passByValue;

/**
 * This class investigates the effects of passing a String as a reference to a
 * method, modifying the String, then checking from the caller if the String is
 * still intact.
 * 
 * <h3>Results:</h3>
 * <p>
 * Name initially set to: Oh Chin Boon
 * </p>
 * <p>
 * After calling modifyContents: Oh Chin Boon
 * </p>
 * 
 * @author Oh Chin Boon
 * 
 */
public class StringPassByValueApp {
	private static void modifyContents(String name) {
		name = "Ken Oh";
	}

	public static void main(String args[]) {
		String name;

		name = "Oh Chin Boon";

		System.out.println("Name initially set to: " + name);

		modifyContents(name);

		System.out.println("After calling modifyContents: " + name);
	}
}
